﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using DLV.Utilities;

namespace DLV.Data.Entities
{
    public class CusRequestController
    {
        public int InsertCusRequest(CusRequestInfo info)
        {
            return SQL.InsertCusRequest(info.CusRequestCode, info.CusNameRequest, info.CusRequestBeginDate, info.CusRequestEndDate, info.CusRequestOther, info.CusRequestTypeId,info.CusCreatedBy, info.CusCreatedDate, info.CusUpDatedBy, info.CusUpDatedDate, info.CusStatus);
        }
        public void UpdateCusRequest(CusRequestInfo info)
        {
            SQL.UpdateCusRequest(info.CusRequestCode, info.CusNameRequest, info.CusRequestBeginDate, info.CusRequestEndDate, info.CusRequestOther, info.CusRequestTypeId, info.CusCreatedBy, info.CusCreatedDate, info.CusUpDatedBy, info.CusUpDatedDate, info.CusStatus, info.IDCusRequest);
        }
        public void DeleteCusRequest(CusRequestInfo info)
        {
            DeleteCusRequest(info.IDCusRequest);
        }
        public void DeleteCusRequest(int idCusRequest)
        {
            SQL.DeleteCusRequest(idCusRequest);
        }
        public CusRequestInfo GetCusRequest(int idCusRequest)
        {
            return CBO.FillObject<CusRequestInfo>(SQL.GetCusRequest(idCusRequest));
        }
        public List<CusRequestInfo> ListCusRequest()
        {
            return CBO.FillCollection<CusRequestInfo>(SQL.ListCusRequest());
        }
        public DataTable SelectCusRequest()
        {
            return CBO.ConvertToDataTable(ListCusRequest(), typeof(CusRequestInfo));
        }
    }
}
